#ifndef MAIN_RENDER_STATE_H_
#define MAIN_RENDER_STATE_H_

#include "NonCopyable.h"
#include "Singleton.h"
#include "GameState.h"
#include "Scene.h"
#include "AntTweakBar.h"

struct MainRenderStateData
{
    MainRenderStateData() :
    tileMode(0), whichBuild(0), 
    numThreads(0), taskSplit(0), recursion(1),
    taskDivision(0), smoothShading(false), numLights(1), pointLights(false) {}
    int tileMode;   //0 none, 1 per thread, 2 per task
    int whichBuild; //0 simple procedural,
                    //1 complicated procedural,
                    //2 simple mesh
                    //3 city mesh
    int numThreads; // 1-8
    int taskSplit; //0 - yes, 1 - no
    int taskDivision; //1,4,16,64,256,1024
    bool smoothShading;
    int numLights;
    bool pointLights;
    int recursion;
};
//the playable state
class MainRenderState : public GameState, public NonCopyable
{
private:
    MainRenderState();
    friend class Singleton<MainRenderState>;

public:
    /* GameState OverRides */
	virtual void	Update();
	virtual void	Draw();
	virtual void	Initialise();
	virtual void	CleanUp();
	virtual void	OnResume();

    /* Event Handling OverRides*/
    virtual void OnKeyBoardDownEvent(const SDL_KeyboardEvent& Event);
    void SetData(MainRenderStateData& data){m_data = data;}
    void ResetCamera();
    void ChangeDirection();
private:
    //Screen sizes
    int m_screenX;
    int m_screenY;
    Scene m_scene;
    MainRenderStateData m_data;
    TwBar* m_bar;
    void SetUpUI();
    float m_frameDisplay;
    bool m_work;
    int m_workCount;
    double m_FrameTimeDisplay;
};

typedef Singleton<MainRenderState> TheMainRenderState;

#endif